package com.weather.modules.controller;

import com.weather.common.vo.City;
import com.weather.modules.service.CityDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "城市列表微服务")
@RestController
@RequestMapping("/cities")
public class CityDataController {

    @Autowired
    private CityDataService cityDataService;

    @ApiOperation("获取城市列表微服务")
    @RequestMapping(value = "/listCity",method = RequestMethod.GET)
    public List<City> listCity() throws Exception {
        return cityDataService.listCity();
    }
}
